<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>333</div>
    <p>
        abc
        <span>111
            <span>444</span>
        </span>
        <span>222</span>
    </p>
    <script>
        /* 
            innerText和innerHTML的区别
        */
        const pObj = document.querySelector("p");
        console.log(pObj.innerText);//innerText:获取的是该标签下(包含子元素)的所有文本元素

        console.log(pObj.innerHTML);


    </script>
</body>

</html>